import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import Cookie from 'js-cookie'

Vue.config.productionTip = false

Vue.use(ElementUI);


new Vue({
  router,
  store,
  render: h => h(App),
  created(){
    // 点击浏览器刷新按钮时，重新调用store中的函数
    store.commit('addMenu',router)
    store.commit('setImage',Cookie.get('imageUrl'))
    store.commit('setStatus',Cookie.get('status'))
    store.commit('setUsername',Cookie.get('username'))
  }
}).$mount('#app')
